home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 19 / Amiga Format CD19 (1997-10-02)(Future Publishing)(GB)(Track 1 of 5)[!][issue 1997-11].iso / -seriously_amiga- / shareware / sound / ays-thx2 / thx-replayer.doc < prev    next >
Text File  |  1997-08-26  |  6KB  |  138 lines

  1. ;-------------------T-----------T-----------------T---------T---------------
  2.  
  3. ;=============================================================================
  4. ;=============================================================================
  5. ;===================== t h x - s o u n d   s y s t e m =======================
  6. ;=============================================================================
  7. ;================= b i n a r y - r e p l a y e r   d o c u ===================
  8. ;=============================================================================
  9. ;=============================================================================
  10. ;========================= v e r s i o n   2 . 0 ! ===========================
  11. ;=============================================================================
  12. ;=============================================================================
  13.  
  14. - been working on 68000 version, but couldn't test if 68000 version still
  15. - has some odd addressing in it as i didn't bring my a500 to the party 6!
  16. - so sorry that other guys had to fix the player to 68000er....
  17. - sorry folx, again if u need one FORGET it, sorry but filter precalcing
  18. - quite suxx on a500 :-)) and who needs 68000 replayer anyway ??
  19.  
  20. How to use the replayer in my own productions ??
  21.  - Here we go (take a look at the example source!-and contact me!)
  22.  
  23. 1. Include the "THX-Offsets.I" file
  24. 2. Include the "THX-Replayer.BIN" file (100% pc-relative) <needn't be chip>
  25. 3. Call the following procedures as described:
  26.    for example: jsr thxReplayer+thxInitCIA
  27.                 jsr thxReplayer+thxInitPlayer
  28.                 jsr thxReplayer+thxInitModule (or BSR if in the same section!)
  29. 4. To access e.g. the volume etc. (the thx_p... variables as seen in the
  30.    "THX-Offsets.I" file), proceed like this: (access them by byte!)
  31.  
  32. ;---- thxGetSubsongs
  33. ;thxGetSubsongs move.l      a6,-(sp)
  34. ;               move.l      thxReplayer+thxBSS_P(pc),a6  ;get ptr to
  35. ;               moveq       #0,d0                        ;players public
  36. ;               move.b      thx_pSubsongs(a6),d0         ;memory
  37. ;               move.l      (sp)+,a6                     ;and get nr. of
  38. ;               RTS                                      ;subsongs from there
  39.  
  40.    You may then also set the thx_pPlaying flag to non-0 if the immediate play
  41.    value was set to non-zero in thxInitSubSong or you may set the volume, get
  42.    your external timing (if you read out the ext. timing value, be sure to
  43.    clear the BYTE after reading it!) or see if the song has reached its end.
  44.  
  45. 5. That's it, now some technical information!
  46.  
  47.  
  48.  
  49. ;            ----==== a Little Function-Overview ====----
  50.  
  51.  
  52. ; All Inputs are LONGWORDS, please!
  53.  
  54.  
  55. ;---- thxInitCIA
  56. ;
  57. ; Inputs: a0: pointer to your cia-interrupt (return with RTS please!)
  58. ;         d0: 0 for system-friendly level 1 i think (called by exec.cause)
  59. ;             others are NOT YET included!
  60. ;
  61. ; Output: d0:  0 for success
  62. ;             -1 for error (so don't call thxKillCIA then later!)
  63. ;
  64. : Function: will try to get one of amiga's cia-interrupts (system-method!)
  65. ;           non-system hard-core code will follow in the next version or
  66. ;           contact me for that if you need it (anyway, everybody has a
  67. ;           cia-irq routine, right?!
  68. ;           Support for multiple-speed modules using your own cia will
  69. ;           follow aswell (possibly...)
  70.  
  71.  
  72. ;---- thxInitPlayer
  73. ;
  74. ; Inputs: a0: pointer to 412150 bytes of public (fast) memory
  75. ;         a1: pointer to   2560 bytes of explicit chip memory
  76. ;      or null-pointer(s) (sub.l a0,a0 and/or sub.l a1,a1) for auto-allocation!
  77. ; *NEW*   d0: zero (0) for LoadWavesFile if possible
  78. ;             one (1) for ExplicitWavesPrecalcing
  79. ;
  80. ; Output: d0: non-zero (-1) for failure, zero (0) for no error!
  81. ;
  82. : Function: Will precalc the few waveforms and (if a0/a1 = 0) allocate
  83. ;           player's memory-blocks (auto-allocation is recommended!)
  84. ;           This function will also precalc the filter-waves, so
  85. ;           it may take some time depending on your cpu power...
  86.  
  87.  
  88. ;---- thxInitModule
  89. ;
  90. ; Inputs: a0: pointer to a THX-Module
  91. ;
  92. ; Output: d0: non-zero (-1) for failure, zero (0) for no error!
  93. ; *NEW*   d0: minus-two (-2) for 2x/3x/4x-speed module failed due no cia
  94. ;             was initialized (2x/3x/4x only works with cia!)
  95. ; Function: Initializes the THX-Module given
  96. ;
  97. ; Bugs: No output value WAS returned until version v2.0 - Sorry
  98.  
  99.  
  100. ;---- thxInitSubSong
  101. ;
  102. ; Inputs: d0: subsong number (0 means main tune, 1 means first subsong etc.)
  103. ;         d1: immediate play (zero means immediately play when thxInterrupt is
  104. ;                             called, non-zero means wait until thx_pPlaying
  105. ;                             flag is set to non-zero) normally use 0 here!
  106. ;
  107. ; Function: Initializes the subsong given
  108.  
  109.  
  110. ;---- thxInterrupt
  111. ;
  112. ; Function: Plays 1/50 of a second, so you'll have to call it every 1/50 sec.!
  113. ;           If possible, use the inbuilt thxInitCIA, as you can't play
  114. ;           2x/3x/4x-speed tunes with vbl-irq !!!
  115.  
  116.  
  117. ;---- thxStopSong
  118. ;
  119. ; Function: Stops the current playing song.
  120.  
  121.  
  122. ;---- thxKillPlayer
  123. ;
  124. ; Function: Shuts down the audio-channels and deallocates the two memory
  125. ;           blocks as long as they were allocated by thxInitPlayer itsself!
  126.  
  127.  
  128. ;---- thxKillCIA
  129. ;
  130. ; Function: Removes the cia-interrupt from system, call only if you're
  131. ;           sure it was initialized correctly!! (thxInitCIA returns 0/-1)
  132.  
  133.  
  134.  
  135. ; If ya wanna e.g. set the volume, contact me, i'll tell you !
  136.  
  137. ; Take a look at the example source!!      - dexter/abyss! signing off!
  138.